<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <title></title>
  <link href="/admin/styles/general.css" rel="stylesheet" type="text/css" />
  <link href="/admin/styles/main.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="/admin/js/utils.js"></script>
  <script type="text/javascript" src="/admin/js/selectzone.js"></script>
  <script type="text/javascript" src="/admin/js/colorselector.js"></script>
  <script type="text/javascript" src="/admin/js/calendar.php?lang="></script>
</head>
<body>
<h1>
  <span class="action-span"><a href="goods.php?act=list">商品列表</a></span>
  <span class="action-span1"><a href="index.php?act=main">SHOP 管理中心 </a> </span><span id="search_id" class="action-span1"> - 编辑商品信息 </span>
  <div style="clear:both"></div>
</h1>

<div class="tab-div">
   
      <form action="" method="post" enctype="multipart/form-data">
      <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
      商品名：　<input type="text" name="name" value="<?php echo $row->goods_name; ?>"><br>
      商品分类：<select name="cat">
        <option>--请选择--</option>
        <?php foreach ($msg as $key=>$val){?>
        <option value="<?php echo $val->cat_id; ?>"><?php echo $val->cat_name; ?></option>
        <?php }  ?>
      </select><br>
      商品价格：<input type="text" name="price" value="<?php echo $row->goods_price; ?>"><br>
      商品图片：<input type="file" name="pic"><img src="<?php echo $row->goods_img ?> "width='50' height='50'/><br>
    <input type="submit" value="修改">  
      </form>
      
    </div>
</div>


<div id="footer">
  版权所有 &copy; 2006-2013 
</div>
<script type="text/javascript" src="/admin/js/tab.js"></script>
<script type="text/javascript">
  function addImg(obj){
      var src  = obj.parentNode.parentNode;
      var idx  = rowindex(src);
      var tbl  = document.getElementById('gallery-table');
      var row  = tbl.insertRow(idx + 1);
      var cell = row.insertCell(-1);
      cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-");
    }

    function removeImg(obj){
      var row = rowindex(obj.parentNode.parentNode);
      var tbl = document.getElementById('gallery-table');
      tbl.deleteRow(row);
    }

    function dropImg(imgId){
      Ajax.call('goods.php?is_ajax=1&act=drop_image', "img_id="+imgId, dropImgResponse, "GET", "JSON");
    }

    function dropImgResponse(result){
      if (result.error == 0){
          document.getElementById('gallery_' + result.content).style.display = 'none';
      }
    }

</script>
</body>
</html>